<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>数据表重跑页面</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
    <h3>数据表重跑页面</h3>
    <form th:object="${rerun}" >
        <select id="table"  class="width-40 chosen-select"  name="tableName">
            <option th:value="请选择" selected>-----请选择-----</option>
            <option th:value="${rerun.qs_Bill}">清算-挂账表【T_BUZ_BILL_DATA】</option>
            <option th:value="${rerun.qs_Merchant}">清算-商户表【T_BUZ_MERCHANT】</option>
            <option th:value="${rerun.qs_Settlement}">清算-结算表【T_BUZ_SETTLEMENT_DATA】</option>
            <option th:value="${rerun.fr_DLRAccountInfo}">日结-代理人账户结算信息表【DLR_ACCOUNTINFO】</option>
            <option th:value="${rerun.fr_DLRAccountSum}">日结-代理人账户汇总表【DLR_ACCOUNTSUM】</option>
            <option th:value="${rerun.fr_RJAccountSum}">日结-结算信息汇总表【RJFR_ACCOUNTSUM】</option>
            <option th:value="${rerun.fr_RJFRAccountInfo}">日结-账户结算信息表【RJFR_ACCOUNTINFO】</option>
            <option th:value="${rerun.fr_RjfrTxWater}">日结-提现流水表【RJFR_TX_WATER】</option>
            <option th:value="${rerun.fr_RJAccountFlow}">日结-账户流水【RJFR_ACCOUNT_FLOW】</option>
            <option th:value="${rerun.fr_RJCzFrWater}">日结-充值分润流水跑批表【RJFR_CZFR_WATER】</option>
            <option th:value="${rerun.fr_RJCzFxWater}">日结-充值返现流水跑批表【RJFR_CZFX_WATER】</option>
            <option th:value="${rerun.fr_RJFyWater}">日结-费用流水表【RJFR_FY_WATER】</option>
            <option th:value="${rerun.fr_RJGcWater}">日结-轧差流水表【RJFR_GC_WATER】</option>
            <option th:value="${rerun.fr_MJDetailWater}">日结-秒结明细流水【MJ_DETAIL_WATER】</option>
            <option th:value="${rerun.fr_TbAccountInfo}">日结-同步结算信息表【TB_ACCOUNTINFO】</option>
            <option th:value="${rerun.fr_DLRTbAccountInfo}">日结-代理人同步结算信息表【DLR_TB_ACCOUNTINFO】</option>
        </select>
        <input type="button" th:onclick="'javascript:run();'" value = "重跑" />
        <h5>重跑状态：</h5><br>
        <h5>重跑结果：</h5><p th:text="${returnData}" />
    </form>

    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script th:inline="javascript">
        let basePath = [[${#httpServletRequest.getScheme() + "://" + #httpServletRequest.getServerName() + ":" + #httpServletRequest.getServerPort() + #httpServletRequest.getContextPath()}]];
        function run() {
            let newURL = $("#table option:selected").val();
            if (newURL=="请选择"){
                alert("请选择需要重跑的表");
                return;
            }
            $.ajax({
                url: basePath + "/submit",
                type: 'post',
                dataType: 'json',
                data: {
                    "newURL":newURL
                },
                cache: false,
                async: true,
                success: function (data) {
                    alert("恭喜！重跑完成，请观察数据的准确性");
                }
            });
        }
    </script>
</body>
</html>
